import {
	baseURL
} from '@/config/config.js'
import cacheFunc from '@/utils/cache.js'

export function uploadFile(tempFilePaths) {
	const header = {
		token: cacheFunc.getCache('busToken') || ''
	}
	return new Promise(function(resolve, reject) {
		uni.uploadFile({
			url: baseURL + 'appUser/uploadImg', //post请求的地址
			filePath: tempFilePaths,
			name: 'file',
			header,
			success: (uploadFileRes) => {
				resolve(JSON.parse(uploadFileRes.data).data)
			}
		})
	})


}
